package view
{
	import ui.GameSettingUI;
	import laya.events.Event;

	/**
	 * ...
	 * @author
	 */
	public class GameSetting extends GameSettingUI{
		public function GameSetting(){
			btn_ok.on(Event.CLICK,this,this.onClickOK);
			bar_speed.on(Event.CHANGE,this,this.onChangeSpeed);
			check_useGyroscope.on(Event.CLICK,this,this.onCilckGyroscope);
		}

		private function onClickOK():void
		{
			GameManager.getInstance().closeGameSetting();
		}

		private function onChangeSpeed():void
		{
			GameManager.CAMERA_ROTATION_SPEED = GameManager.CAMERA_ROTATION_SPEED_MIN + (GameManager.CAMERA_ROTATION_SPEED_MAX - GameManager.CAMERA_ROTATION_SPEED_MIN) * (bar_speed.value / 100.0)
		}

		private function onCilckGyroscope():void
		{
			GameManager.useGyroscope = check_useGyroscope.selected;
		}
	}
}